import fetch from 'utils/fetch';

// 新增广告接口
export function addAdvert(data) {
  return fetch({
    url: '/api/merc/advertisement/saveAd',
    method: 'post',
    data
  });
}

// 修改广告接口
export function updateAd(data) {
  return fetch({
    url: '/api/merc/advertisement/updateAd/',
    method: 'post',
    data
  });
}

// 删除广告接口
export function deleteAd(id) {
    return fetch({
      url: '/api/merc/advertisement/deleteAd/' + id,
      method: 'get'
    });
  }

// 根据机构id查询广告(App)
export function getAdvert_home(companyId) {
  return fetch({
    url: '/api/merc/advertisement/selectAppAdList/' + companyId,
    method: 'get'
  });
}

// 根据机构id查询广告列表
export function selectAdList(companyId) {
    return fetch({
      url: '/api/merc/advertisement/selectAdList/' + companyId,
      method: 'get'
    });
  }